<script setup>
defineProps(['navigationList'])
</script>

<template>
  <template v-for="item in navigationList" :key="item.id">
    <el-sub-menu :index="item.path" v-if="item.hasOwnProperty('children')">
      <template #title>
        <el-icon>
          <component :is="item.icon" />
        </el-icon>
        <span>{{ item.name }}</span>
      </template>
      <RecursionMenuItem :navigationList="item.children" />
    </el-sub-menu>
    <el-menu-item :index="item.path" v-else>
      <el-icon>
        <component :is="item.icon" />
      </el-icon>
      <span>{{ item.name }}</span>
    </el-menu-item>
  </template>
</template>

<style scoped></style>
